#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "mychannel.h"
#include "client.h"
#include "newwindow.h"
#include "newwindsend.h"
#include <Windows.h>
#include <QTimer>
#include <QMainWindow>
#include <QStandardItemModel>

namespace Ui {
	class MainWindow;
}

class MainWindow : public QMainWindow
{
	Q_OBJECT

private:
	Ui::MainWindow* ui;
	MyChannel* _myChannel;
	QWebEnginePage* page;
	Client* _tcpclient;

    // QIcon *iconMoveToRight, *iconMoveStop;
    bool planeIsMove,planeSelfIsMove;
    // Recv affairs
    newWindow *configWindow;
    QString recvData;
    int recvMsgCnt;
    bool recvWndIsOpen;
    // Send affairs
    NewWindSend *sendWindow;
    bool sendWndIsOpen;

public:
	explicit MainWindow(QWidget* parent = 0);
	~MainWindow();


private:

    // 获取CPU信息
    SYSTEM_INFO systemInfo;
    MEMORYSTATUSEX statusex;
    // show cpu info
    void ShowMachineInfo();
    // set timer
    QTimer *mTime;

private slots:
    void on_btn_recv_clicked();
    void on_btnMoveIcon_clicked();
    // recv from server
    void WndDsplyData(QString data);
    // recv from new wnd and send to server
    void SendToServer(QString);
    void on_btn_send_clicked();
    void on_btn_moveplaneicon_clicked();
    void on_btn_reconn_clicked();
};

#endif // MAINWINDOW_H
